//=== Base stream definitions ==================================================

#define IN_P    float4 Position  : POSITION;
#define IN_C0   float4 Color     : COLOR;
#define IN_TBASE float2 baseTC   : TEXCOORD0; 

// ==== Additional streams ==================================

#define IN_TANG_STREAM                \
#if !_RT_SKELETON_SSD                \
          float4 Tangent  : TANGENT;  \
          float4 Binormal : BINORMAL; \
#else                                 \
          float4 Tangent  : TANGENT;  \
#endif

#ifdef XENON
#define IN_SKIN_STREAM float4 BlendWeights : BLENDWEIGHT; int4 BlendIndices : BLENDINDICES;
#else
#define IN_SKIN_STREAM float4 BlendWeights : BLENDWEIGHT; float4 BlendIndices : BLENDINDICES;
#endif

#define IN_SHAPEDEFORM_STREAM			\
		float4 ShapeDeformInfo : COLOR1;\
		float3 Thin : TEXCOORD4;		\
		float3 Fat  : TEXCOORD5;			\

#define IN_MORPHTARGET_STREAM				\
		float3 MorphTargetDelta : POSITION3;\

  
//=== Vertex shader output ===================================================

// Note: Removing isolate from HPosition saves ~20% VS ALU, and very significant waterfalling cost
// 	 Opto limited to skinned shaders for now. Non-skinned requires some more testing to ensure no z-fighting is introduced

#ifdef XENON 			
	#define ISOLATE 		\
	#if _RT_SKELETON_SSD 		\
	[isolate]			\	
	#endif				
#else
	#define ISOLATE
#endif

#ifdef XENON
	#define OUT_P    				\
	#if _RT_SKELETON_SSD                	\
	float4 HPosition : POSITION;		\
	#else					\
	[isolate] float4 HPosition : POSITION;	\
	#endif					
#else
	#define OUT_P float4 HPosition : POSITION;		
#endif

#ifdef CAFE
  #define IN_WPOS float4 WPos : TEXCOORD7
#else
 #if D3D10
  #define IN_WPOS float4 WPos : POSITION
 #else
  #define IN_WPOS float4 WPos : VPOS
 #endif
#endif


#if D3D11

#define MSAA_SAMPLE_INDEX_PS		\
	#if _PS		\
		#if %_RT_MSAA_SAMPLEFREQ_PASS		\
			uint uSample     : SV_SAMPLEINDEX;		\
		#endif		\
	#endif

#else

	#define MSAA_SAMPLE_INDEX_PS 

#endif

#define OUT_C0   half4 Color     : COLOR0;
#define OUT_C1   half4 Color1    : COLOR1;

//=== Pixel shader output structure ==========================================

struct pixout
{
  half4 Color  : COLOR0;
};

struct pixout_fp
{
  float4 Color  : COLOR0;
};

